package com.after.saas.common.constants;


import lombok.Getter;

@Getter
public enum StatusEnum implements IResultEnum {

    ENABLE(0, "启用"),
    DISABLE(1, "禁用"),
    ;
    private final int code;
    private final String desc;

    StatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static StatusEnum getCode(int code) {
        for (StatusEnum s : StatusEnum.values()) {
            if (s.code == code) {
                return s;
            }
        }
        return ENABLE;
    }

    @Override
    public String message() {
        return desc;
    }

    @Override
    public int value() {
        return code;
    }
}
